<?php
namespace Products\Model;

class Productsnew
{
	public $product_id;
	public $category_id;
	public $brandcode;
	public $genericname;
	public $fuction;
	public $manufacturer;
	public $origin_country;
	public $quntity;
	public $unites;
	public $year_of_manufacture;
	public $package;
	public $per;
	public $suggested_price;
	public $min_price;
	public $user_id;
	public $p_status;
	public $user_currency;
	public $type;
	public $email;
	public $company_name;
	public $parent_user_id;
	public $user_type;
	public $nicename;
	public $category_name;
	public $admin_user_id;
	public $superadmin_user_id;
	public $saleing;
	public $selling_country;
	
	public function exchangeArray($data){
	
		$this->product_id  = (isset($data['product_id'])) ? $data['product_id']	  : null;
		
		$this->category_id = (isset($data['category_id'])) ? $data['category_id']	: null;
		
		$this->brandcode   = (isset($data['brandcode']))  ? $data['brandcode']	  : null;
		
		$this->genericname = (isset($data['genericname'])) ? $data['genericname'] : null;
		
		$this->fuction     = (isset($data['fuction']))     ? $data['fuction']      : null;
		
		$this->manufacturer= (isset($data['manufacturer'])) ? $data['manufacturer']: null;
		
		$this->origin_country =(isset($data['origin_country'])) ? $data['origin_country']
		: null;
		
		$this->quntity    = (isset($data['quntity'])) ? $data['quntity']	  : null;
		
		$this->unites      = (isset($data['unites'])) ? $data['unites']	  : null;
		
		$this->year_of_manufacture      = (isset($data['year_of_manufacture'])) ? $data['year_of_manufacture']	  : null;
		
		$this->package      = (isset($data['package'])) ? $data['package']	  : null;
		
		$this->per      	= (isset($data['per'])) ? $data['per']	  : null;
		
		$this->suggested_price      = (isset($data['suggested_price'])) ? $data['suggested_price']	  : null;
		
		$this->min_price      = (isset($data['min_price'])) ? $data['min_price']	  : null;
	
		$this->user_id      = (isset($data['user_id'])) ? $data['user_id']	  : null;
		$this->p_status      = (isset($data['p_status'])) ? $data['p_status']	  : null;
		$this->user_currency      = (isset($data['user_currency'])) ? $data['user_currency']	  : null;
		$this->type      = (isset($data['type'])) ? $data['type']	  : null;
		$this->email      = (isset($data['email'])) ? $data['email']	  : null;
		$this->company_name      = (isset($data['company_name'])) ? $data['company_name']	  : null;
		$this->parent_user_id      = (isset($data['parent_user_id'])) ? $data['parent_user_id']	  : null;
		$this->user_type      = (isset($data['user_type'])) ? $data['user_type']	  : null;
		$this->nicename      = (isset($data['nicename'])) ? $data['nicename']	  : null;
		$this->category_name      = (isset($data['category_name'])) ? $data['category_name']	  : null;
		$this->admin_user_id      = (isset($data['admin_user_id'])) ? $data['admin_user_id']	  : null;
		$this->superadmin_user_id      = (isset($data['superadmin_user_id'])) ? $data['superadmin_user_id']	  : null;
		$this->saleing      = (isset($data['saleing'])) ? $data['saleing']	  : null;
		$this->selling_country      = (isset($data['selling_country'])) ? $data['selling_country']	  : null;
		
	}

	// Add the following method:
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}

}